const ejs = require('ejs')
const fs = require('fs')
const express = require('express')
const app = express()

// let name = '张三'
// let result = ejs.render('我是 <%= name %>',{name})
// console.log(result)

let name = 'saber'
let message = '有很多人都在笑着，我认为那一定不会错的'
let result = ejs.render(fs.readFileSync('./01_模板.html').toString(),{name,message})
console.log(result)

app.get('/',function(req,res){
    res.sendFile(__dirname + '/01_模板.html')
})
app.listen(3000,() => { 
    console.log('服务启动成功....')
 })

